package com.dmcb.common.business.utils;

import com.dmcb.common.business.entities.MapEntity;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by long on 2015/7/13.
 */
public class MapUtil {

    public static Map<String, Integer> toMap(List<MapEntity> list) {
        if (ListUtil.isEmpty(list)) {
            return null;
        }
        Map<String, Integer> map = new HashMap<String, Integer>();
        for (MapEntity entity : list) {
            map.put(entity.getValue(), entity.getKey());
        }
        return map;
    }

}
